<?php
$connect = mysqli_connect('localhost','root','root','thinkcmf');
mysqli_set_charset($connect,'utf8');
if(!$connect){
    echo '数据库连接失败';
    die;
}
$id = $_GET['id'];
$sql = "delete from cmf_student where id = $id";
$res = mysqli_query($connect, $sql);

if ($res) {
    echo json_encode(['code' => 1, 'msg' => '删除成功', 'data' => []]);
} else {
    echo json_encode(['code' => 2, 'msg' => '删除失败', 'data' => []]);
}